/********************************************
 * 功能说明: 
 * 模块名称: 
 * 系统名称: 
 * 软件版权: 
 * 系统版本: 1.0.0
 * 开发人员: zhangfb
 * 开发时间: 2019/4/9 15:40
 * 审核人员: 
 * 相关文档: 
 * 修改记录: 修改日期 修改人员 修改说明
 *********************************************/
package com.hyacinth.activity.entity;

import com.hyacinth.entity.DataItemEntity;
import com.hyacinth.utils.DateUtils;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import java.math.BigDecimal;
import java.util.Calendar;
import java.util.Date;

/**
 * 活动方案基类
 * @author zhangfb
 * @version 1.0.0.1
 * @since JDK 1.8
 */
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@MappedSuperclass
public abstract class ActivityPlan extends DataItemEntity {

    private static final long serialVersionUID = 1L;

    /**活动状态**/
    @Column(nullable = false, length = 2)
    protected String status;
    /**活动开始时间**/
    @Column(nullable = false)
    protected Date begTime;
    /**活动结束时间**/
    @Column(nullable = false)
    protected Date endTime;
    /**活动期内商家促销次数**/
    @Column(length = 4)
    protected Integer promoteNum;
    /**商家每次促销上限**/
    @Column(length = 4)
    protected Integer perPromoteLimit;
    /**周内指定星期几参加活动，多天逗号隔开**/
    @Column(nullable = false, length = 16)
    protected String daysOfWeek;
    /**用户参与活动周期，每天、每周、每月...**/
    @Column(length = 2)
    protected String partiPeriod;
    /**用户每个活动周期参与上限，每天参与10次**/
    protected Integer perPartiLimit;
    /**单次促销奖励额度最高值**/
    @Column(precision = 10, scale = 2, columnDefinition = "decimal(10,2) default 0.00")
    protected BigDecimal maxReward;
    /**单次促销奖励额度最低值**/
    @Column(precision = 10, scale = 2, columnDefinition = "decimal(10,2) default 0.00")
    protected BigDecimal minReward;
    /**活动触发类型**/
    protected String triggerType;
    /**触发时机说明**/
    protected String triggerDesc;

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Date getBegTime() {
        return begTime;
    }

    public void setBegTime(Date begTime) {
        this.begTime = begTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public String getDaysOfWeek() {
        return daysOfWeek;
    }

    public void setDaysOfWeek(String daysOfWeek) {
        this.daysOfWeek = daysOfWeek;
    }

    public String getPartiPeriod() {
        return partiPeriod;
    }

    public void setPartiPeriod(String partiPeriod) {
        this.partiPeriod = partiPeriod;
    }

    public Integer getPromoteNum() {
        return promoteNum == null ? 0 : promoteNum;
    }

    public void setPromoteNum(Integer promoteNum) {
        this.promoteNum = promoteNum;
    }

    public Integer getPerPromoteLimit() {
        return perPromoteLimit == null ? 0 : perPromoteLimit;
    }

    public void setPerPromoteLimit(Integer perPromoteLimit) {
        this.perPromoteLimit = perPromoteLimit;
    }

    public Integer getPerPartiLimit() {
        return perPartiLimit == null ? 0 : perPartiLimit;
    }

    public void setPerPartiLimit(Integer perPartiLimit) {
        this.perPartiLimit = perPartiLimit;
    }

    public String getTriggerType() {
        return triggerType;
    }

    public void setTriggerType(String triggerType) {
        this.triggerType = triggerType;
    }

    public BigDecimal getMaxReward() {
        return maxReward == null ? BigDecimal.ZERO : maxReward;
    }

    public void setMaxReward(BigDecimal maxReward) {
        this.maxReward = maxReward;
    }

    public BigDecimal getMinReward() {
        return minReward == null ? BigDecimal.ZERO : minReward;
    }

    public void setMinReward(BigDecimal minReward) {
        this.minReward = minReward;
    }

    public String getTriggerDesc() {
        return triggerDesc;
    }

    public void setTriggerDesc(String triggerDesc) {
        this.triggerDesc = triggerDesc;
    }
}
